package com.rg.util;

import org.junit.Test;
import static org.junit.Assert.*;

public class CalculateTest{
    Calculate test1;

    @Before
    public void setUp() {
        System.out.println("Before");
        test1 = new Calculate();
    }

    @Afterclass
    public static void tearDownAfterClass() {
        System.out.println("Finished");
    }

    @Test
    public void testInitExpression() {
        System.out.println("testInitPression:");
        test1.initExpression();
        assertEquals((1+2)*3, test1.getExp());
    }

    @Test
    public void testVerifyExpression() {
        System.out.println("testVerifyExpression:");
        test1.initExpression();
        assertEquals(false, test1.verifyExpression());
    }

    @Test
    public void testExpressionEvaluation() {
        System.out.println("testExpressionEvaluation():");
        test1.initExpression();
        assertEquals(9, test1.expressionEvaluation());
    }
}